﻿<%@ Page Title="" Language="C#"   MasterPageFile="~/Admin_panel/Admin.master" AutoEventWireup="true" CodeFile="BanTin.aspx.cs" Inherits="Admin_BaiViet" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    
    <div class="content-box">
        <!-- Start Content Box -->

        <div class="content-box-header">

            <h3>Quản lý bản tin</h3>

            <ul class="content-box-tabs">
                <li><a href="#tab1" class="default-tab">Danh sách bản tin</a></li>
                <!-- href must be unique and match the id of target div -->
                <li><a href="#tab2">Viết bài mới</a></li>
            </ul>

            <div class="clear"></div>

        </div>
        <!-- End .content-box-header -->

        <div class="content-box-content">

            <div class="tab-content  default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server">
                    <ContentTemplate>

                        <asp:GridView Width="100%" ID="_grid_bantin" runat="server" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" PageSize="50" GridLines="None" OnRowDeleting="_grid_bantin_RowDeleting" DataKeyNames="IDTin">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:TemplateField HeaderText="Chọn ">
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkselectAll" runat="server" OnCheckedChanged="chkInGridviewHeader_CheckedChanged" AutoPostBack="true" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkchon" Enabled="true" Checked="false" runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="IDTin" HeaderText="ID">
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="40px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TieuDe" HeaderText="Tiêu đề" />
                                <asp:BoundField DataField="NgayDang" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày đăng">
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="70px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Sửa">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("IDTin", "Suabaiviet.aspx?idbt={0}") %>' Text="Sửa"></asp:HyperLink>
                                    </ItemTemplate>
                                    <ControlStyle Width="20px" />
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Xóa">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButtonxoa" runat="server" CausesValidation="false"
                                            CommandName="Delete" Text="Xóa" OnClientClick="return confirm('Bạn có chắc chắn xóa không?')"></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                                </asp:TemplateField>

                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <table>
                            <tfoot>
                                <tr>
                                    <td>
                                        <div class="bulk-actions align-left">
                                            <asp:Button OnClientClick="return confirm('Bạn chắc chắn muốn xóa những mục đã chọn?(Y/N)');" class="button" ID="btn_xoa" OnClick="btn_xoa_Click" runat="server" Text="Xóa mục đã chọn" />
                                        </div>
                                    </td>
                                </tr>
                            </tfoot>
                        </table>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btn_xoa" EventName="Click" />

                    </Triggers>
                </asp:UpdatePanel>
            </div>
            <!-- End #tab1 -->

            <div class="tab-content" id="tab2">
                <fieldset>
                    <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->

                    <p>
                        <label>Tiêu đề bản tin</label>
                        <asp:TextBox class="text-input medium-input" ID="txtbantin" runat="server" OnTextChanged="txtbantin_TextChanged"></asp:TextBox>

                        <!-- Classes for input-notification: success, error, information, attention -->
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtbantin" runat="server" ErrorMessage="<span class='input-notification error png_bg'>Chưa nhập tiêu đề bản tin</span>"></asp:RequiredFieldValidator>
                        <br />
                        <small>Tiêu đề bản tin</small>
                    </p>

                    <p>
                        <label>Nội dung tóm tắt</label>
                        <asp:TextBox ID="txtnoidungtomtat" runat="server" class="text-input medium-input" TextMode="MultiLine"></asp:TextBox>

                        <br />
                        <small>Nội dung tóm tắt giới hạn trong một đoạn văn bản khoảng tối đa 200 từ</small>

                    </p>

                    <p>
                        <br />
                        <label>Nội dung chi tiết</label>
                        <FCKeditorV2:FCKeditor ID="FCK_bantin" runat="server" ToolbarSet="Simple"></FCKeditorV2:FCKeditor>

                        <p>
                        </p>
                        <p>
                            <asp:Button ID="btnDangBT" runat="server" class="button" OnClick="btnDangBT_Click" Text="Đăng bài viết" />
                            &nbsp;
                             <asp:Button ID="btnhuy" runat="server" class="button" Text="Hủy bỏ" />
                            &nbsp;&nbsp;&nbsp;
                             <asp:Label ID="Label1" runat="server"></asp:Label>
                        </p>

                        <p>
                        </p>

                        <p>
                        </p>

                    </p>

                </fieldset>

            </div>
            <!-- End #tab2 -->

        </div>
        <!-- End .content-box-content -->

    </div> <!-- End .content-box -->

</asp:Content>

